package com.chiwen.system.service.impl;

import java.util.List;

import com.chiwen.system.domain.SysPayway;
import com.chiwen.system.mapper.SysPaywayMapper;
import com.chiwen.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.chiwen.system.service.ISysPaywayService;

/**
 * 支付通道Service业务层处理
 * 
 * @author Dipepr
 * @date 2022-11-13
 */
@Service
public class SysPaywayServiceImpl implements ISysPaywayService 
{
    @Autowired
    private SysPaywayMapper sysPaywayMapper;

    /**
     * 查询支付通道
     * 
     * @param wayId 支付通道主键
     * @return 支付通道
     */
    @Override
    public SysPayway selectSysPaywayByWayId(Integer wayId)
    {
        return sysPaywayMapper.selectSysPaywayByWayId(wayId);
    }

    /**
     * 查询支付通道列表
     * 
     * @param sysPayway 支付通道
     * @return 支付通道
     */
    @Override
    public List<SysPayway> selectSysPaywayList(SysPayway sysPayway)
    {
        return sysPaywayMapper.selectSysPaywayList(sysPayway);
    }

    /**
     * 新增支付通道
     * 
     * @param sysPayway 支付通道
     * @return 结果
     */
    @Override
    public int insertSysPayway(SysPayway sysPayway)
    {
        sysPayway.setCreateTime(DateUtils.getNowDate());
        return sysPaywayMapper.insertSysPayway(sysPayway);
    }

    /**
     * 修改支付通道
     * 
     * @param sysPayway 支付通道
     * @return 结果
     */
    @Override
    public int updateSysPayway(SysPayway sysPayway)
    {
        sysPayway.setUpdateTime(DateUtils.getNowDate());
        return sysPaywayMapper.updateSysPayway(sysPayway);
    }

    /**
     * 批量删除支付通道
     * 
     * @param wayIds 需要删除的支付通道主键
     * @return 结果
     */
    @Override
    public int deleteSysPaywayByWayIds(Integer[] wayIds)
    {
        return sysPaywayMapper.deleteSysPaywayByWayIds(wayIds);
    }

    /**
     * 删除支付通道信息
     * 
     * @param wayId 支付通道主键
     * @return 结果
     */
    @Override
    public int deleteSysPaywayByWayId(Integer wayId)
    {
        return sysPaywayMapper.deleteSysPaywayByWayId(wayId);
    }
}
